import request from '/@/utils/request';

/**
API
 */
export function useRoleApi() {
	return {
		add: (params?: object) => {
			return request({
				url: '/system-admin/sys-role/add',
				method: 'post',
				data: params,
			});
		},
		getPage: (params?: object) => {
			return request({
				url: '/system-admin/sys-role/page',
				method: 'post',
				data: params,
			});
		},
		getMenuByRoleId: (params?: object) => {
			return request({
				url: '/system-admin/sys-role/getMenuByRoleId',
				method: 'get',
				params,
			});
		},
		edit: (params?: object) => {
			return request({
				url: '/system-admin/sys-role/edit',
				method: 'post',
				data: params,
			});
		},
		del: (params?: object) => {
			return request({
				url: '/system-admin/sys-role/del',
				method: 'post',
				data: params,
			});
		},
		getAll: () => {
			return request({
				url: '/system-admin/sys-role/list',
				method: 'get',
			});
		},
	};
}
